# $Id: PKGBUILD 74948 2012-08-10 04:05:00Z kkeen $
# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: Marq Schneider <queueRAM@gmail.com>

pkgname=kicad-docs-bzr
pkgver=352
_bzrver=352
pkgrel=1
pkgdesc="Kicad user documentation and localization"
arch=('any')
url="http://iut-tice.ujf-grenoble.fr/kicad/"
license=('GPL')
replaces=('kicad-doc-bzr')
makedepends=('cmake' 'bzr')
options=('docs')
source=()
md5sums=()
_bzrtrunk="lp:~kicad-developers/kicad/doc"
_bzrmod="kicad-doc"

build() {
  cd "$srcdir"
  msg "Connecting to BZR server..." 
  if [ ! -d "$srcdir/$_bzrmod" ] ; then
    bzr co --lightweight --revision $_bzrver $_bzrtrunk $_bzrmod
  else
    bzr up $_bzrmod
  fi
  msg "BZR checkout done or server timeout"

  mkdir -p "$srcdir/$_bzrmod/build/Release"
  cd "$srcdir/$_bzrmod/build/Release"
  cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
}

package() {
  cd "$srcdir/$_bzrmod/build/Release"

  make DESTDIR="$pkgdir" install
}
